package com.ita.compeople.impl;

import java.rmi.RemoteException;
import java.util.List;

import com.ita.command.Command;
import com.ita.dao.DepartmentDao;
import com.ita.dao.PeopleDao;
import com.ita.po.People;
import com.ita.po.ReturnValue;

public class CmdAllPeople implements Command {
	
	private PeopleDao peopleDao;

	
	public CmdAllPeople(PeopleDao peopleDao) {
		super();
		this.peopleDao = peopleDao;
	}


	@Override
	public ReturnValue execute() throws RemoteException {
		List<People> list = peopleDao.showAllPeople();
		for(People p : list){
			System.out.println(p.toString());
		}
			System.out.println("Select Success!");
		ReturnValue returnValue = new ReturnValue();
		returnValue.setpList(list);
		return returnValue;
	}

}
